package cn.com.huzo.model.entities.purchase;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 对账单明细实体类
 *
 * @author 吴旭
 */
public class NotesPayabledLinesEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 5808482346591910462L;
    private String LinesId;
    private Long HeaderId;                  // 对账单标识
    private Long StockInHeaderId;           // 所属入库单标识
    private String StockInLinesId;          // 对账用入库单明细标识
    private Long PoHeaderId;                // 引入的采购订单标识
    private String PoNo;                    // 订单合同号
    private String StyleNo;                 // 订单款号
    private Timestamp ArrivalDate;          // 到货日期
    private Long MaterialId;                // 材料
    private String MaterialName;            // 材料名
    private String MaterialCode;            // 料号
    private Double Coefficient;             // 转换系数
    private String MaterialColourNumber;    // 材料色号
    private String MaterialColourName;      // 材料颜色
    private String Specification;           // 规格
    private String ActualSpecification;     // 实到规格
    private String YarnCount;               // 纱支
    private String FabricWidth;             // 幅宽
    private String GramWeight;              // 克重
    private String LotNo;                   // 缸号
    private Long UomId;                     // 计量单位
    private String UomName;
    private Double StockInQuantity;         // 入库数量
    private Double PoQuantity;              // 订单数量
    private Double PayabledQuantity;        // 结算数量
    private Double PayabledAmount;          // 结算金额
    private Double UnitPriceAddedTax;       // 单价
    private Double UnitPriceExcludedTax;    // 不含税单价
    private Double AmountAddedTax;          // 含税金额（=结算金额？）
    private Double AmountExcludedTax;       // 不含税金额
    private String InvoiceNo;               // 发票号
    private Date InvoiceDate;               // 发票日期
    private Double InvoiceAmount;           // 发票金额
    private Double TaxRate;                 // 税率
    private String Description;             // 备注
    private String Destination;             // 发货目的地
    private Short RowFlag;                  // 行标记 1 正常行 2 非材料花费 3 小计行

    public String getLinesId() {
        return LinesId;
    }

    public void setLinesId(String LinesId) {
        this.LinesId = LinesId;
    }

    public Long getHeaderId() {
        return HeaderId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public Long getStockInHeaderId() {
        return StockInHeaderId;
    }

    public void setStockInHeaderId(Long StockInHeaderId) {
        this.StockInHeaderId = StockInHeaderId;
    }

    public String getStockInLinesId() {
        return StockInLinesId;
    }

    public void setStockInLinesId(String StockInLinesId) {
        this.StockInLinesId = StockInLinesId;
    }

    public Long getPoHeaderId() {
        return PoHeaderId;
    }

    public void setPoHeaderId(Long PoHeaderId) {
        this.PoHeaderId = PoHeaderId;
    }

    public String getPoNo() {
        return PoNo;
    }

    public void setPoNo(String PoNo) {
        this.PoNo = PoNo;
    }

    public String getStyleNo() {
        return StyleNo;
    }

    public void setStyleNo(String StyleNo) {
        this.StyleNo = StyleNo;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getArrivalDate() {
        return ArrivalDate;
    }

    public void setArrivalDate(Timestamp ArrivalDate) {
        this.ArrivalDate = ArrivalDate;
    }

    public Long getMaterialId() {
        return MaterialId;
    }

    public void setMaterialId(Long MaterialId) {
        this.MaterialId = MaterialId;
    }

    public String getMaterialName() {
        return MaterialName;
    }

    public void setMaterialName(String MaterialName) {
        this.MaterialName = MaterialName;
    }

    public String getMaterialCode() {
        return MaterialCode;
    }

    public void setMaterialCode(String MaterialCode) {
        this.MaterialCode = MaterialCode;
    }

    public Double getCoefficient() {
        return Coefficient;
    }

    public void setCoefficient(Double Coefficient) {
        this.Coefficient = Coefficient;
    }

    public String getMaterialColourNumber() {
        return MaterialColourNumber;
    }

    public void setMaterialColourNumber(String MaterialColourNumber) {
        this.MaterialColourNumber = MaterialColourNumber;
    }

    public String getMaterialColourName() {
        return MaterialColourName;
    }

    public void setMaterialColourName(String MaterialColourName) {
        this.MaterialColourName = MaterialColourName;
    }

    public String getSpecification() {
        return Specification;
    }

    public void setSpecification(String Specification) {
        this.Specification = Specification;
    }

    public String getActualSpecification() {
        return ActualSpecification;
    }

    public void setActualSpecification(String ActualSpecification) {
        this.ActualSpecification = ActualSpecification;
    }

    public String getYarnCount() {
        return YarnCount;
    }

    public void setYarnCount(String YarnCount) {
        this.YarnCount = YarnCount;
    }

    public String getFabricWidth() {
        return FabricWidth;
    }

    public void setFabricWidth(String FabricWidth) {
        this.FabricWidth = FabricWidth;
    }

    public String getGramWeight() {
        return GramWeight;
    }

    public void setGramWeight(String GramWeight) {
        this.GramWeight = GramWeight;
    }

    public String getLotNo() {
        return LotNo;
    }

    public void setLotNo(String LotNo) {
        this.LotNo = LotNo;
    }

    public Long getUomId() {
        return UomId;
    }

    public void setUomId(Long UomId) {
        this.UomId = UomId;
    }

    public String getUomName() {
        return UomName;
    }

    public void setUomName(String UomName) {
        this.UomName = UomName;
    }

    public Double getStockInQuantity() {
        return StockInQuantity;
    }

    public void setStockInQuantity(Double StockInQuantity) {
        this.StockInQuantity = StockInQuantity;
    }

    public Double getPoQuantity() {
        return PoQuantity;
    }

    public void setPoQuantity(Double PoQuantity) {
        this.PoQuantity = PoQuantity;
    }

    public Double getPayabledQuantity() {
        return PayabledQuantity;
    }

    public void setPayabledQuantity(Double PayabledQuantity) {
        this.PayabledQuantity = PayabledQuantity;
    }

    public Double getPayabledAmount() {
        return PayabledAmount;
    }

    public void setPayabledAmount(Double PayabledAmount) {
        this.PayabledAmount = PayabledAmount;
    }

    public Double getUnitPriceAddedTax() {
        return UnitPriceAddedTax;
    }

    public void setUnitPriceAddedTax(Double UnitPriceAddedTax) {
        this.UnitPriceAddedTax = UnitPriceAddedTax;
    }

    public Double getUnitPriceExcludedTax() {
        return UnitPriceExcludedTax;
    }

    public void setUnitPriceExcludedTax(Double UnitPriceExcludedTax) {
        this.UnitPriceExcludedTax = UnitPriceExcludedTax;
    }

    public Double getAmountAddedTax() {
        return AmountAddedTax;
    }

    public void setAmountAddedTax(Double AmountAddedTax) {
        this.AmountAddedTax = AmountAddedTax;
    }

    public Double getAmountExcludedTax() {
        return AmountExcludedTax;
    }

    public void setAmountExcludedTax(Double AmountExcludedTax) {
        this.AmountExcludedTax = AmountExcludedTax;
    }

    public String getInvoiceNo() {
        return InvoiceNo;
    }

    public void setInvoiceNo(String InvoiceNo) {
        this.InvoiceNo = InvoiceNo;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy、MM", timezone = "GMT+8")
    public Date getInvoiceDate() {
        return InvoiceDate;
    }

    public void setInvoiceDate(Date InvoiceDate) {
        this.InvoiceDate = InvoiceDate;
    }

    public Double getInvoiceAmount() {
        return InvoiceAmount;
    }

    public void setInvoiceAmount(Double InvoiceAmount) {
        this.InvoiceAmount = InvoiceAmount;
    }

    public Double getTaxRate() {
        return TaxRate;
    }

    public void setTaxRate(Double TaxRate) {
        this.TaxRate = TaxRate;
    }

    public String getDescription() {
        return Description;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    public String getDestination() {
        return Destination;
    }

    public void setDestination(String Destination) {
        this.Destination = Destination;
    }

    public Short getRowFlag() {
        return RowFlag;
    }

    public void setRowFlag(Short RowFlag) {
        this.RowFlag = RowFlag;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof NotesPayabledLinesEntity)) {
            return false;
        }

        final NotesPayabledLinesEntity that = (NotesPayabledLinesEntity) o;

        return new EqualsBuilder()
                .append(this.getLinesId(), that.getLinesId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + this.getLinesId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
